home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / ppascal.zip / SPIRAL3.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-24  |  1KB  |  33 lines

  1. program spiral3;
  2.   { makes a really neeto spiral of a random color }
  3.  
  4. uses
  5.   Crt, Graph;
  6. const
  7.   width          = 1;        { width of the line: 1 = narrow, 3 = wide }
  8.   finalDiam      = 2000;     { the final diameter of the spiral        }
  9.   betweenWidth   = 2;        { distance between the lines              }
  10.   startingradius = 1;        { initial spiral radius                   }
  11. var
  12.   graphDriver,
  13.   ErrorCode,
  14.   GraphMode   : integer;
  15.   radius      : integer;
  16.   ch          : char;
  17. begin
  18.   graphdriver := detect;
  19.   InitGraph( Graphdriver, GraphMode, 'c:\utils\tp');
  20.   ErrorCode := Graphresult;
  21.   if errorcode <> grOk then halt(1);
  22.   randomize;
  23.   setcolor ( random (getmaxColor - 1 ) + 1 );  {sets color of spiral }
  24.   setlinestyle( 0, 0, width);
  25.   radius := startingradius;
  26.   repeat
  27.     circle ( 320,240,radius);
  28.     inc ( radius, betweenwidth );
  29.   until ( radius > finaldiam ) or ( keypressed);
  30.   if keypressed then ch := readkey;
  31.   ch := readkey;
  32.   closegraph;
  33. end.